package com.linkme2night.model;

public final class Rate {

	private int clubberID;
	private int venueID;
	private float rate;
	private float[] rateValues = { 0.5f,1, 1.5f, 2, 2.5f, 3, 3.5f, 4, 4.5f, 5 };

	public Rate(int clubberID, int venueID, float rate) {
		this.clubberID = clubberID;
		this.venueID = venueID;
		if (isRateValid(rate))
			this.rate = rate;
		else
			throw new RuntimeException(Rate.class.getSimpleName()
					+ " out of bounds");

	}

	private boolean isRateValid(float rate) {
		for (int i = 0; i < rateValues.length; i++)
			if (rateValues[i] == rate)
				return true;

		return false;
	}

	public int getVenueID() {
		// TODO Auto-generated method stub
		return venueID;
	}

	public float getRate() {
		// TODO Auto-generated method stub
		return rate;
	}

	public int getClubberID() {
		// TODO Auto-generated method stub
		return clubberID;
	}
}
